package cn.elves.model.draw.controller;

import cn.elves.model.activity.entity.po.Activity;
import cn.elves.model.draw.entity.dto.DrawDTO;
import cn.elves.model.draw.service.DrawService;
import cn.elves.model.entity.dto.response.ResponseDTO;
import cn.elves.model.rule.entity.po.RuleTree;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("drawing")
public class DrawingController {

    @Resource
    private DrawService drawService;

    @PostMapping("/doDraw/{userId}/{activityId}")
    public ResponseDTO<Long> doDraw(@RequestBody DrawDTO drawDTO) {
        return ResponseDTO.success(drawService.doDraw(drawDTO));
    }

    @PostMapping("/ruleTree")
    public ResponseDTO<Activity> saveActivity(RuleTree ruleTree) {
        return ResponseDTO.success();
    }
}
